package com.domain.VO;

import com.common.util.StringUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;

/**
 * 航班过滤规则
 * @author 大忽悠
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class FlightChoseRoleVo {
    private String cityLeave;
    private String cityArrive;
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    private LocalDateTime timeLeave;
    /**
     * 是否选择是经济舱,不勾选,默认为经济舱选项
     */
    private Boolean poorSeat;

    public void setCityLeave(String cityLeave) {
        this.cityLeave = StringUtil.getNullIfEmptyOrNull(cityLeave);
    }

    public void setCityArrive(String cityArrive) {
        this.cityArrive = StringUtil.getNullIfEmptyOrNull(cityArrive);
    }

    public Boolean getPoorSeat() {
        return poorSeat==null?Boolean.TRUE:Boolean.FALSE;
    }
}
